package tw.com.softleader.spring.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import tw.com.softleader.spring.dao.CalculateDao;

@Service
public class CalculateService {
	
	@Autowired
	private CalculateDao calculateDao;
	
	public List<String> getAll(){
		return calculateDao.findAll();
	}
	
	public String getOne(Long id){
		return calculateDao.findOne(id);
	}
	
	public Integer add(Integer a, Integer b){
		return a+b;
	}
	
	public Integer sub(Integer a, Integer b){
		return a-b;
	}
	
	public Double divide(Double a, Double b){
		return a/b;
	} 
	
	public Integer mult(Integer a, Integer b){
		return a*b;
	}

	public void setCalculateDao(CalculateDao calculateDao) {
		this.calculateDao = calculateDao;
	} 
}
